get XScrollBoxML(initial,"Choose among these:",card field "scroller","Help")
go this card
if it is "Help" then
answer "You pushed the 'Help' button."
else if it is "cancel" then
answer "You pushed the 'Cancel' button."
else if it is empty then
answer "You did not select anything."
else
get XScrollBoxML(0,"These are the ones you choose:",it)
end if
end mouseUp
-- part 5 (field)
-- low flags: 01
-- high flags: 2007
-- rect: left=18 top=32 right=286 bottom=384
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name: Documentation
-- part contents for card part 2
----- text -----
able
baker
charlie
dog
ernest
fox
gamma
horse
ice cream
jumping jack flash
knockwurst
liver
monkey
no way, jose
occularity
penelope
qwerty
rapscallion
salubrious
twinkle toes
underwhelmed
vermin
wascally wabbit
yokel
zenzational
-- part contents for card part 5
----- text -----
XScrollBoxML version 2.4
Roger Brown
XScrollBoxML is a version HyperCard XFCN XScrollBox that allows the user to make multiple selections like XScrollBoxM. The difference is that each selection is returned in a separate line of the result. This makes it easier to handle selection items with embedded commas.
The return value is a list of lines in the format:
number,text <cr>
number,text <cr>
..
number,text
where number is the number of a selection
text is the text of the selection with that number
Selection can be made by:
1. double-clicking on a line.
2. single-clicking on a line, then pressing the OK button.
3. single-clicking on a line, then pressing the Return key.
4. typing the first letter(s) of a selection, then doing 1,2, or 3.
(Note: type selection assumes that the lines are
ordered alphabetically)
5. scrolling with up and down arrow keys, then doing 1,2 or 3.
Multiple selection is made by holding down the shift key while
clicking.
If the Cancel button is pressed, the string "Cancel" is returned.
It requires that the DITL and DLOG resources (1348) packaged
with it are in the stack.
The dialog is centered on the screen and sized to hold the width of the longest line and/or the prompt line, whichever is widest. It will not overrun the width of a Mac+ screen.
INVOKING XScrollBoxML
get XScrollBoxML(first,prompt,container,userButton)
where first is a list of 1 or more default selections in the list -
either numbers or an item list of text strings (0 if
none). NOTE: the text must exactly match what is in
the field!
prompt is a string to prompt the user. This appears at the
top of the dialog box.
container is any hypercard container (field, variable),
presumed to be multi-lined.
UserButton is the name for an optional author specified
button. If this button is pressed, its name is returned
further processing by the script.
EXAMPLE
ex. get XScrollBoxML("1,2,3","Choose:",card field 1,"Help")
if OK is pressed, returns : 1,text of line 1 of card field 1<cr>
2,text of line 2 of card field 1<cr>
3,ext of line 3 of card field 3
REVISION HISTORY
2.3 3/30/90 first public release
2.4 - 4/17/90 revived a feature that had disappeared: specifying
the default selection in XScrollBox and XScrollBox F as a